# -*- coding:utf-8 -*-

"""
测试百分比 购买流程优化，20%流量
"""

from aw import *
from autotest import *

import time


class Test_013(TestCase):
    def setUp(self):
        print("Test_001 setUp")

    def test(self):
        # d = {"丁盼": "15013590958",
        #      "刘骏": "15872097043",
        #      "刘颖": "13828752923",
        #      "胡鑫": "18370995219",
        #      "周旺": "18570602290",
        #      "陈春林": "13929535270",
        #      "周志强": "18664938853",
        #      "张兴垣": "18694982851",
        #      "邬志鹏": "13538003385",
        #      "程天超": "18148912905",
        #      "徐雪霞": "18565687532",
        #      "李信慧": "13632945571",
        #      "刘云海": "18670229814",
        #      "李志标": "13632945571",
        #      "赖琪沐": "13826011672",
        #      "张海山": "15327266579",
        #      "黄凯丽": "13760285225",
        #      "叶质熙": "13603074330",
        #      "何兆武": "15013680440", }
        # d = {"丁盼": "15013590958",
        #      "刘骏": "15872097043",
        #      "刘颖": "13828752923",
        #      "胡鑫": "18370995219",
        #      "周旺": "18570602290",
        #      "陈春林": "13929535270",
        #      "周志强": "18664938853",
        #      "张兴垣": "18694982851",
        #      "邬志鹏": "13538003385",
        #      "程天超": "18148912905",
        #      "徐雪霞": "18565687532",
        #      "李信慧": "13632945571",
        #      "刘云海": "18670229814",
        #      "赖琪沐": "13826011672",
        #      "何兆武": "15013680440", }

        t = ['13424377735', '13600000001', '15999569544', '15817303592', '13421836306', '18925252746', '13631511096',
             '18523307763', '13713535461', '15999951376', '18850494644', '15999615961', '18328582944', '13028806961',
             '13387617379', '13632959460', '13530753143', '13530883695', '13534086245', '13538003385', '13556804701',
             '13570919354', '13580517072', '13590241219', '13603074330', '13613013167', '13631223572', '13631393878',
             '13631597157', '13631610648', '13631621707', '13632945571', '13641436263', '13670275386', '13677415326',
             '13682330541', '13682651308', '13682939483', '13686483827', '13691743510', '13713147430', '13717071829',
             '13724373235', '13726201274', '13726259155', '13726261142', '13728734092', '13728881664', '13751122150',
             '13760276565', '13760285225', '13763308813', '13796320002', '13798568950', '13798570615', '13802266481',
             '13811147749', '13823154579', '13825288850', '13826011672', '13826473629', '13828752923', '13828776795',
             '13828784405', '13870660518', '13910283830', '13922398841', '13922444784', '13923001219', '13923764653',
             '13926515286', '13928446626', '13971532303', '13998875091', '15012476018', '15013490495', '15013590958',
             '15013680440', '15014913417', '15104657649', '15118041521', '15118153871', '15180061424', '15217729392',
             '15302656001', '15327266579', '15527905961', '15625863060', '15626210038', '15626477602', '15673419427',
             '15710089075', '15773141476', '15778582387', '15802773901', '15813323840', '15813849160', '15813879355',
             '15816863153', '15817448495', '15817482051', '15818762655', '15872097043', '15889968001', '15908601008',
             '15913023126', '15914098863', '15915710039', '15915979381', '15919874572', '15920400978', '15927098677',
             '15970261800', '15986245742', '15986795213', '15999951642', '17017519814', '17322349528', '17322372782',
             '17328377125', '17512082064', '17606501821', '17620460140', '17665498716', '17688737945', '17722683230',
             '17727492240', '17770844260', '18026904582', '18028795558', '18038051534', '18038086858', '18038089127',
             '18145813821', '18148912905', '18182076287', '18218140076', '18218493686', '18218676908', '18219241300',
             '18221987035', '18270282487', '18277363725', '18305980070', '18312512920', '18318442308', '18370247103',
             '18370995219', '18503019339', '18503034104', '18519118571', '18519283808', '18520880249', '18520880477',
             '18565687532', '18565690760', '18566220082', '18566293998', '18566622422', '18566686118', '18566772480',
             '18570602290', '18575597767', '18576708917', '18576776815', '18607480207', '18620340532', '18620957565',
             '18624010105', '18664346340', '18664938853', '18665378978', '18670100827', '18670229814', '18674852475',
             '18675273490', '18680358884', '18680361231', '18682019944', '18682032174', '18682062032', '18682107475',
             '18682120285', '18682135407', '18682241012', '18682254268', '18682303361', '18682307152', '18700000011',
             '18720825131', '18720989209', '18760324748', '18810022300', '18814444511', '18818860374', '18820936250',
             '18823351063', '18823401262', '18825172487', '18826138720', '18826139836', '18826406283', '18843779266',
             '18883991830', '18899761313', '18922898287', '18923408360', '18923885247', '18926565843', '18929379028',
             '18929526058', '18972337897', '18989861405', '18998907243']

        count = 0
        for phone in t:
            try:
                # Common.login(num)
                url = "https://lcts1.ssjlicai.com/fixinws/ws/product/v1/productList"
                # url = "https://lcts1.ssjlicai.com/fixinws/ws/product/v1/memberExclusiveProductList"
                # url = "https://lcts1.ssjlicai.com/fixinws/ws/product/v1/newUserProduct"
                res = Common.testUrl(url, isLogin=True, phoneNumber=phone)
                if Common.validDetailA(res):
                    count += 1
            except Exception as e:
                logger.error("{}无法登录".format(phone))

        print("总数量：{}".format(len(list(d.keys()))))
        print("实验组数量：{}".format(count))


def tearDown(self):
    print("Test_001 tearDown")
